package com.feiluan.rest.controller;


import com.feiluan.service.CaptureScreenService;
import org.springframework.http.ResponseEntity;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
/**
 * Demo Controller to Test Rest API
 *
 * @author Moniruzzaman Md
 *
 */
@RestController
public class IotRestController {

	@Resource
	private CaptureScreenService captureScreenService;

	@RequestMapping(value = "/iot/infoScreen/captureSC", method = RequestMethod.GET)
	public ResponseEntity<String> getCaptureScreen(@RequestParam(value = "devSn", required = false) String devSn,
												   @RequestParam(value = "picQua", required = false) String picQua,
												   @RequestParam(value = "picSize", required = false) String picSize) {

		MultiValueMap<String, Object> requestBody = new LinkedMultiValueMap<>();
		requestBody.add("devSn", devSn);
		requestBody.add("picQua", picQua);
		requestBody.add("picSize", picSize);

		return captureScreenService.postRequest(requestBody);
	}

}
